package io.kiki.sba.registry.server.metadata.provide.data;

import io.kiki.sba.registry.common.model.console.PersistenceData;
import io.kiki.sba.registry.server.metadata.MetadataLeaderService.LeaderElectorListener;
import io.kiki.sba.registry.store.api.DBResponse;


public interface ProvideDataService extends LeaderElectorListener {

    /**
     * save or update provideData
     */
    boolean saveProvideData(PersistenceData persistenceData);

    /**
     * save or update provideData with expectVersion
     */
    boolean saveProvideData(PersistenceData persistenceData, long expectVersion);

    /**
     * query provideData by key
     */
    DBResponse<PersistenceData> queryProvideData(String key);

    /**
     * delete provideData
     */
    boolean removeProvideData(String key);
}
